<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@include file="header.jsp"%>
	<div class="container">
		<div class="stage">
			<h2 class="stage-heading">输入书籍名称</h2>
			<form id="delete" >
			<input class="form-control" type="text" name="bookname"/>
			<p></p>
			<button id="delete-btn" data-src="book-delete-action.jsp" class="btn btn-lg btn-primary btn-block" type="submit">删除</button>
			</form>
			<script type="text/javascript">
				$(function() {
					$("#delete").submit(function(event) {
						event.preventDefault();
						var url = $("#delete-btn").attr("data-src");
						$.ajax({
							url:url,
							async:false,
							type:'post',
							data:$(this).serialize(),
							dataType:'html',
							context:$("#myModal"),
							success:function(data) {
								$(this).find(".modal-body").html(data);
								$(this).modal('toggle')
							}
						});
					}
				);
				});
			</script>
		</div>
	</div>
	<div id="myModal" class="modal fade">
	  <div class="modal-dialog">
	    <div class="modal-content">
	      <div class="modal-header">
	        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
	        <h4 class="modal-title">提示</h4>
	      </div>
	      <div class="modal-body">
	        <p>One fine body&hellip;</p>
	      </div>
	      <div class="modal-footer">
	        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
	      </div>
	    </div><!-- /.modal-content -->
	  </div><!-- /.modal-dialog -->
	</div><!-- /.modal -->
</body>
</html>